package com.sven.hello;

import com.sven.hello.self.MySource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.messaging.Source;
import org.springframework.messaging.support.MessageBuilder;

@EnableBinding(MySource.class)
public class SendService {

    @Autowired
    private MySource mySource;


    public void sendMsg(String msg){
        mySource.output().send(MessageBuilder.withPayload(msg).build());
    }
}
